package com.tourism.website.articlemanage.mapper;

import com.tourism.website.articlemanage.entity.ArticleCategory;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tourismwebsite.articlemanage.dto.ArticleManageDTO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author kevin
 * @since 2024-06-11
 */
@Mapper
public interface ArticleCategoryMapper extends BaseMapper<ArticleCategory> {
    //从种类（category）中查询到该分类(category)中的所有文章ID
    @Select("SELECT * FROM article_category WHERE category_id = #{categoryId}")
    List<Integer> queryCategoryToArticleID(Integer categoryId);
    @Delete("DELETE FROM article_category WHERE article_id = #{articleId}")
    int deleteArticleManage(Integer articleId);
}
